package grpc

import (
	"context"
	"app/pb"
)

func (*UserService) Ping(ctx context.Context,in *pb.PingRequest) (*pb.PongReply, error) {
	return &pb.PongReply{Pong:"pong"}, nil
}

func (g *UserService) CreateUser(ctx context.Context,in *pb.CreateUserRequest) (*pb.CreateUserReply, error) {

	ui,err := g.db.CreateUser(ctx,in.Username,in.Password)

	if err != nil {
		return nil, err
	}

	return &pb.CreateUserReply{Id:ui.Id}, nil
}

